import {loadAssets} from "../../../../common/assets/loadAssets";
import {host} from "../../../../app";
import {fgui} from "../../../../../libs/fairygui.1.3.0";

export let uiPkgName = 'bouncyDunk';

export function loadUi(onProgress = null, onSuccess = null) {
    let assets = [
        {name: 'bouncyDunk', url: host + '/assets/fui/ui.zip', options: {xhrType: 'arraybuffer'}}
    ];
    loadAssets(
        assets,
        onProgress,
        () => {
            fgui.UIPackage.addPackage(uiPkgName);
            if (onSuccess) {
                onSuccess();
            }
        }
    );
}